import request from '@/utils/request'

// 分页获取成果记录
export function getAchievementList(params) {
  return request({
    url: '/api/achievement/page',
    method: 'get',
    params
  })
}

// 获取成果详情
export function getAchievementDetail(id) {
  return request({
    url: `/api/achievement/${id}`,
    method: 'get'
  })
}

// 新增成果
export function createAchievement(data) {
  return request({
    url: '/api/achievement',
    method: 'post',
    data
  })
}

// 更新成果
export function updateAchievement(data) {
  return request({
    url: '/api/achievement',
    method: 'put',
    data
  })
}

// 删除成果
export function deleteAchievement(id) {
  return request({
    url: `/api/achievement/${id}`,
    method: 'delete'
  })
}
